package com.gdupt.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gdupt.entity.CustomerInfo;
import com.gdupt.entity.DrawPlan;
import com.gdupt.mapper.CustomerInfoMapper;
import com.gdupt.mapper.DrawPlanMapper;
import com.gdupt.service.IDrawPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 制定计划 制定计划 服务实现类
 * </p>
 *
 * @author gdupt
 * @since 2018-11-21
 */
@Service
public class DrawPlanServiceImpl extends ServiceImpl<DrawPlanMapper, DrawPlan> implements IDrawPlanService {

    @Autowired
    private  DrawPlanMapper drawPlanMapper;

    @Transactional
    @Override
    public boolean editPlan(DrawPlan drawPlan) {
        return drawPlanMapper.editPlan(drawPlan);

    }

    @Transactional
    @Override
    public DrawPlan findPlanById(Integer id) {
        return drawPlanMapper.findPlanById(id);

    }

    @Transactional
    @Override
    public boolean deletePlan(Integer id) {
        return drawPlanMapper.deletePlan(id);

    }

    @Override
    public boolean deletePlanBySid(Integer id) {
        return drawPlanMapper.deletePlanBySId(id);
    }

    @Transactional
    @Override
    public boolean editPlanResult(DrawPlan drawPlan) {
        return   drawPlanMapper.editPlanResult(drawPlan);
    }


    @Transactional
    @Override
    public List<DrawPlan> findAllPlanById(Page page,Integer id) {
        List<DrawPlan> allPlans = drawPlanMapper.findAllPlanById(page,id);
        return  allPlans;
}

    @Transactional
    @Override
    public boolean savePlan(DrawPlan drawPlan) {
        return  drawPlanMapper.savePlan(drawPlan);

    }

    @Transactional
    @Override
    public List<DrawPlan> searchPlan(String search) {
        List<DrawPlan> drawPlans = drawPlanMapper.searchPlan(search);
        return drawPlans;

    }

    @Override
    public boolean failPLan(Integer id) {
        return drawPlanMapper.failPlan(id);
    }

    @Override
    public boolean sucessPLan(Integer id) {
        return drawPlanMapper.sucessPlan(id);
    }

}
